import request from '../request'
//合并购物车路径
let MERGE_URL = '/member/cart/merge'
//线上购物车列表
let CART_URL = '/member/cart'
//删除接口
let CART_DEL = '/member/cart'
//添加接口
let CART_ADD = '/member/cart'

//分类数据的设置api
export function mergecart(arr) {
    return request({
        url: MERGE_URL,
        method: 'post',
        data: arr,
    })
}

//线上购物车列表
export function cartlist() {
    return request({
        url: CART_URL,
        method: 'get',
    })
}
//线上购物车数据删除
export function cartdel(ids, clearAll = false, clearInvalid = false) {
    return request({
        url: CART_DEL,
        method: 'delete',
        data: { ids, clearAll, clearInvalid }
    })
}
//线上购物车数据添加
export function cartadd(skuId, count) {
    return request({
        url: CART_ADD,
        method: 'post',
        data: { skuId, count }
    })
}